package br.ufc.vv.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import br.ufc.vv.dao.DaoFactory;
import br.ufc.vv.model.Usuario;

public class CmdListarTodosUsuarios implements Comando {

	@Override
	public String executar(HttpServletRequest request,
			HttpServletResponse response) {

		List<Usuario> usuarios = DaoFactory.findUsuariosCadastrados();

		HttpSession session = request.getSession(true);

		if (usuarios != null) {
			session.setAttribute("usuarios", usuarios);
			return "paginaJSP";
		}
		return null;

	}

}
